#ifndef BCFREEOUTFLOWWATERDEPTH_HPP
#define BCFREEOUTFLOWWATERDEPTH_HPP

#include "boundaryCondition.hpp"

namespace hms {

template<typename MeshType>
class FreeOutflow_waterdepth : public BoundaryCondition<MeshType>
{
public:
	using BaseType = BoundaryCondition<MeshType>;
	using Type = typename BaseType::Type;
	using BaseType::field;
	using BaseType::patch;

private:
	bool m_isLimited {false};
	scalar m_limit {0};

public:
	FreeOutflow_waterdepth() = default;
	FreeOutflow_waterdepth(
		Field<MeshType>& d,
		const BoundaryPatch&,
		bool isLimited,
		scalar limit = {}
	);

	virtual void update() const override;

	void set( 
		Field<MeshType>& d,
		const BoundaryPatch&,
		bool isLimited,
		scalar limit = {}
	);

	void setLimit( bool isLimited, scalar limit );

	bool isLimited() const;
	void isLimited( bool );

	auto limit() const -> scalar;
	void limit( scalar );
};

} // end namespace hms

#endif
